package com.itheima.demo05;


public class CodeTest {
    public static void main(String[] args) {
        //空参构造
        //1. 创建类的对象.
        Code codeMan = new Code();
        //2. 给属性赋值
        codeMan.setName("王五");
        codeMan.setSalary(50000);
        codeMan.setId(999);
        //3. 打印属性值
        System.out.println("姓名:" + codeMan.getName() + "工号:" + codeMan.getId() + "工资:" + codeMan.getSalary());
        //4. 调用成员方法
        codeMan.work();
        System.out.println("-------------------------");

        //全参构造
        //1. 创建对象
        Code codeMan2 = new Code(666, 2000, "赵六");
        //2. 打印属性.
        System.out.println("姓名:" + codeMan2.getName() + "工号:" + codeMan2.getId() + "工资:" + codeMan2.getSalary());
        //3. 调用方法
        codeMan2.work();
    }

}
